package org.nowcoder.huawei.other;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class HJ60 {
    private static boolean isPrime(int val) {
        for (int i = 2; i <= val / 2; i++) {
            if (val % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void hj60(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int val = Integer.parseInt(br.readLine());
        int mul = 1000;
        int k = 0;
        int v = 0;
        for (int i = 2; i <= val; i++) {
            if (isPrime(i) && isPrime(val - i)) {
                int tmp = Math.abs(val - i - i);
                if (mul > tmp) {
                    mul = tmp;
                    k = i;
                    v = val - i;
                }
            }
        }
        System.out.println(k);
        System.out.println(v);
    }
}
